import requests
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
from pprint import pprint

sp = spotipy.Spotify(
    auth_manager=SpotifyClientCredentials(
        client_id="4093e976c3e746f49af4b31c73e4407a",
        client_secret="758a9e5338104cf1aeb61e0e48927d18",
    )
)
# Whales & Roee Yeger feat. Meggie York
print(
    "artist:"
    + "'Whales Roee Yeger Meggie York'"
    + " album:"
    + "'It's Not Love'"
    + " label:Monstercat"
)
results = sp.search(
    q="artist:"
    + "'Whales Roee Yeger Meggie York'"
    + "album:"
    + "'It's Not Love'"
    + "label:Monstercat",
    type="album",
    limit=10,
)
pprint(results)
release_url = results["albums"]["items"][0]["external_urls"]["spotify"]

response = requests.get("https://song.link/" + release_url)
print(response.url)
